﻿using GDGeek;
using MrPP.Myth;
using UnityEngine;

namespace MrPP.SerriedCabinet
{
 
    public class CheckBroadcast : CheckPost
    {

        [SerializeField]
        private CheckReceiver _receiver;

        public override void doTab(int idx)
        {
            _receiver.tab = idx;
        }

        public override void doLast()
        {
            switch (_receiver.tab)
            {
                case 0:
                    _receiver.waitPage = _receiver.waitPage - 1;
                    break;
                case 1:

                    _receiver.checkPage = _receiver.checkPage - 1;
                    break;
                case 2:
                    _receiver.otherPage = _receiver.otherPage - 1;
                    break;
            }
        }

        public override void doNext()
        {
            switch (_receiver.tab)
            {
                case 0:
                    _receiver.waitPage = _receiver.waitPage + 1;
                    break;
                case 1:
                    _receiver.checkPage = _receiver.checkPage + 1;
                    break;
                case 2:
                    _receiver.otherPage = _receiver.otherPage + 1;
                    break;
            }
        }

        public override void doPlay()
        {
            _receiver.loading();
        }

        public override void doStop()
        {
            _receiver.state = State.Close;
        }

        public override void doCheck(string key)
        {
            _receiver.addCheck(key);
        }

    }
}